package com.springboot.springSessionDemo;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory;
import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession;

@Configuration
//maxInactiveIntervalInSeconds 默认是1800秒过期
@EnableRedisHttpSession(maxInactiveIntervalInSeconds=24*60*60)
public class RedisSessionConfig {
	private Logger log=LoggerFactory.getLogger(RedisSessionConfig.class);
	@Bean
	public LettuceConnectionFactory connectionFactory() {
		log.info("redis-session-config----------------------------------- timeout:"+24*60*60);
		return new LettuceConnectionFactory(); 
	}
}